<template>
    <el-table :data="users" border style="width: 100%">
        <el-table-column prop="id" label="Id" width="180" />
        <el-table-column prop="username" label="userName" width="180" />
        <el-table-column prop="password" label="Password" />
    </el-table>
</template>

<script>
export default {
    name: "UserView",
    data(){
        return{
            users:[]
        }
    },
    methods:{
        loadUsers() {
            //使用axios请求后台
            this.$axios.get('/findUser')
                .then(result => {
                    if (result.data.code === 200) {
                        this.users = result.data.data;
                    }
                })
        }
    },
    mounted() {
        this.loadUsers();
    }
}
</script>

<style scoped>

</style>